<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simpleregistry</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/pythongoogledesktop/">PyGoogleDesktop</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;simpleregistry
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="simpleregistry-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="simpleregistry-module.html">Module simpleregistry</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-docstring">Simplest Windows Registry I/0</tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">Title: Simplest Registry I/O</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring">Submitter: Jack Trainor (other recipes)</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-docstring">Last Updated: 2007/08/24</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-docstring">Version no: 1.0</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-docstring">Category: System</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-docstring">http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/528896  </tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-docstring">Description:</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-docstring">Most of the time I just want to either read or write one value to the registry. </tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-docstring">Here are two functions: ReadRegistryValue and WriteRegistryValue plus a few helpers.</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">win32api</tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">win32con</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"> </tt>
<a name="ReadRegistryValue"></a><div id="ReadRegistryValue-def"><a name="L18"></a><tt class="py-lineno">18</tt> <a class="py-toggle" href="#" id="ReadRegistryValue-toggle" onclick="return toggle('ReadRegistryValue');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simpleregistry-module.html#ReadRegistryValue">ReadRegistryValue</a><tt class="py-op">(</tt><tt class="py-param">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">=</tt><tt class="py-string">""</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="ReadRegistryValue-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="ReadRegistryValue-expanded"><a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line">    <tt class="py-docstring">""" Read one value from Windows registry. If 'name' is empty string, reads default value."""</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line">    <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">typeId</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line">        <tt class="py-name">keyHandle</tt> <tt class="py-op">=</tt> <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegOpenKeyEx</tt><tt class="py-op">(</tt><tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">KEY_ALL_ACCESS</tt><tt class="py-op">)</tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line">        <tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">typeId</tt> <tt class="py-op">=</tt> <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegQueryValueEx</tt><tt class="py-op">(</tt><tt class="py-name">keyHandle</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line">        <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegCloseKey</tt><tt class="py-op">(</tt><tt class="py-name">keyHandle</tt><tt class="py-op">)</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-string">"ReadRegistryValue failed:"</tt><tt class="py-op">,</tt> <tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">typeId</tt> </tt>
</div><a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line"> </tt>
<a name="WriteRegistryValue"></a><div id="WriteRegistryValue-def"><a name="L29"></a><tt class="py-lineno">29</tt> <a class="py-toggle" href="#" id="WriteRegistryValue-toggle" onclick="return toggle('WriteRegistryValue');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simpleregistry-module.html#WriteRegistryValue">WriteRegistryValue</a><tt class="py-op">(</tt><tt class="py-param">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">,</tt> <tt class="py-param">typeId</tt><tt class="py-op">=</tt><tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">REG_SZ</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="WriteRegistryValue-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="WriteRegistryValue-expanded"><a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line">    <tt class="py-docstring">""" Write one value to Windows registry. If 'name' is empty string, writes default value.</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"><tt class="py-docstring">        Creates subkeys as necessary"""</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line">        <tt class="py-name">keyHandle</tt> <tt class="py-op">=</tt> <tt id="link-0" class="py-name" targets="Function simpleregistry.OpenRegistryKey()=simpleregistry-module.html#OpenRegistryKey"><a title="simpleregistry.OpenRegistryKey" class="py-name" href="#" onclick="return doclink('link-0', 'OpenRegistryKey', 'link-0');">OpenRegistryKey</a></tt><tt class="py-op">(</tt><tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">)</tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line">        <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegSetValueEx</tt><tt class="py-op">(</tt><tt class="py-name">keyHandle</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">typeId</tt><tt class="py-op">,</tt> <tt class="py-name">data</tt><tt class="py-op">)</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line">        <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegCloseKey</tt><tt class="py-op">(</tt><tt class="py-name">keyHandle</tt><tt class="py-op">)</tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-string">"WriteRegistryValue failed:"</tt><tt class="py-op">,</tt> <tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt> </tt>
</div><a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"> </tt>
<a name="OpenRegistryKey"></a><div id="OpenRegistryKey-def"><a name="L39"></a><tt class="py-lineno">39</tt> <a class="py-toggle" href="#" id="OpenRegistryKey-toggle" onclick="return toggle('OpenRegistryKey');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simpleregistry-module.html#OpenRegistryKey">OpenRegistryKey</a><tt class="py-op">(</tt><tt class="py-param">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="OpenRegistryKey-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="OpenRegistryKey-expanded"><a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line">    <tt class="py-docstring">""" Opens a keyHandle for hiveKey and key, creating subkeys as necessary """</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line">    <tt class="py-name">keyHandle</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line">        <tt class="py-name">curKey</tt> <tt class="py-op">=</tt> <tt class="py-string">""</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line">        <tt class="py-name">keyItems</tt> <tt class="py-op">=</tt> <tt class="py-name">key</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'\\'</tt><tt class="py-op">)</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">subKey</tt> <tt class="py-keyword">in</tt> <tt class="py-name">keyItems</tt><tt class="py-op">:</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">curKey</tt><tt class="py-op">:</tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line">                <tt class="py-name">curKey</tt> <tt class="py-op">=</tt> <tt class="py-name">curKey</tt> <tt class="py-op">+</tt> <tt class="py-string">"\\"</tt> <tt class="py-op">+</tt> <tt class="py-name">subKey</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line">                <tt class="py-name">curKey</tt> <tt class="py-op">=</tt> <tt class="py-name">subKey</tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line">            <tt class="py-name">keyHandle</tt> <tt class="py-op">=</tt> <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegCreateKey</tt><tt class="py-op">(</tt><tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">curKey</tt><tt class="py-op">)</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line">        <tt class="py-name">keyHandle</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-string">"OpenRegistryKey failed:"</tt><tt class="py-op">,</tt> <tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">keyHandle</tt> </tt>
</div><a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line"> </tt>
<a name="DeleteRegistryKey"></a><div id="DeleteRegistryKey-def"><a name="L56"></a><tt class="py-lineno">56</tt> <a class="py-toggle" href="#" id="DeleteRegistryKey-toggle" onclick="return toggle('DeleteRegistryKey');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simpleregistry-module.html#DeleteRegistryKey">DeleteRegistryKey</a><tt class="py-op">(</tt><tt class="py-param">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="DeleteRegistryKey-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="DeleteRegistryKey-expanded"><a name="L57"></a><tt class="py-lineno">57</tt>  <tt class="py-line">    <tt class="py-docstring">""" Deletes a registry key -- must be a leaf key or call fails """</tt> </tt>
<a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line">    <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line">        <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-name">win32api</tt><tt class="py-op">.</tt><tt class="py-name">RegDeleteKey</tt><tt class="py-op">(</tt><tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">)</tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">result</tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line">    <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt> <tt class="py-string">"DeleteRegistryKey failed:"</tt><tt class="py-op">,</tt> <tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line">    <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L64"></a><tt class="py-lineno">64</tt>  <tt class="py-line"> </tt>
<a name="TestRegistryWriteRead"></a><div id="TestRegistryWriteRead-def"><a name="L65"></a><tt class="py-lineno">65</tt> <a class="py-toggle" href="#" id="TestRegistryWriteRead-toggle" onclick="return toggle('TestRegistryWriteRead');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simpleregistry-module.html#TestRegistryWriteRead">TestRegistryWriteRead</a><tt class="py-op">(</tt><tt class="py-param">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">,</tt> <tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">data</tt><tt class="py-op">,</tt> <tt class="py-param">typeId</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="TestRegistryWriteRead-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="TestRegistryWriteRead-expanded"><a name="L66"></a><tt class="py-lineno">66</tt>  <tt class="py-line">    <tt id="link-1" class="py-name" targets="Function simpleregistry.WriteRegistryValue()=simpleregistry-module.html#WriteRegistryValue"><a title="simpleregistry.WriteRegistryValue" class="py-name" href="#" onclick="return doclink('link-1', 'WriteRegistryValue', 'link-1');">WriteRegistryValue</a></tt><tt class="py-op">(</tt><tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">typeId</tt><tt class="py-op">)</tt> </tt>
<a name="L67"></a><tt class="py-lineno">67</tt>  <tt class="py-line">    <tt class="py-name">outputData</tt><tt class="py-op">,</tt> <tt class="py-name">outputTypeId</tt> <tt class="py-op">=</tt> <tt id="link-2" class="py-name" targets="Function simpleregistry.ReadRegistryValue()=simpleregistry-module.html#ReadRegistryValue"><a title="simpleregistry.ReadRegistryValue" class="py-name" href="#" onclick="return doclink('link-2', 'ReadRegistryValue', 'link-2');">ReadRegistryValue</a></tt><tt class="py-op">(</tt><tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">)</tt> </tt>
<a name="L68"></a><tt class="py-lineno">68</tt>  <tt class="py-line">    <tt class="py-name">status</tt> <tt class="py-op">=</tt> <tt class="py-string">"OK"</tt> </tt>
<a name="L69"></a><tt class="py-lineno">69</tt>  <tt class="py-line">    <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">outputData</tt> <tt class="py-op">!=</tt> <tt class="py-name">data</tt> <tt class="py-keyword">or</tt> <tt class="py-name">outputTypeId</tt> <tt class="py-op">!=</tt> <tt class="py-name">typeId</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L70"></a><tt class="py-lineno">70</tt>  <tt class="py-line">        <tt class="py-name">status</tt> <tt class="py-op">=</tt> <tt class="py-string">"FAILED"</tt> </tt>
<a name="L71"></a><tt class="py-lineno">71</tt>  <tt class="py-line">    <tt class="py-keyword">print</tt> <tt class="py-string">"%s -- %d %s %s -- input: %s %s  output: %s %s"</tt> <tt class="py-op">%</tt> \ </tt>
<a name="L72"></a><tt class="py-lineno">72</tt>  <tt class="py-line">        <tt class="py-op">(</tt><tt class="py-name">status</tt><tt class="py-op">,</tt> <tt class="py-name">hiveKey</tt><tt class="py-op">,</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt> <tt class="py-name">name</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">typeId</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">outputData</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">outputTypeId</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L73"></a><tt class="py-lineno">73</tt>  <tt class="py-line"> </tt>
<a name="Test"></a><div id="Test-def"><a name="L74"></a><tt class="py-lineno">74</tt> <a class="py-toggle" href="#" id="Test-toggle" onclick="return toggle('Test');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="simpleregistry-module.html#Test">Test</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Test-collapsed" style="display:none;" pad="++" indent="++++"></div><div id="Test-expanded"><a name="L75"></a><tt class="py-lineno">75</tt>  <tt class="py-line">    <tt id="link-3" class="py-name" targets="Function simpleregistry.TestRegistryWriteRead()=simpleregistry-module.html#TestRegistryWriteRead"><a title="simpleregistry.TestRegistryWriteRead" class="py-name" href="#" onclick="return doclink('link-3', 'TestRegistryWriteRead', 'link-3');">TestRegistryWriteRead</a></tt><tt class="py-op">(</tt><tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">HKEY_LOCAL_MACHINE</tt><tt class="py-op">,</tt> <tt class="py-string">"Software\\AAAAA"</tt><tt class="py-op">,</tt> <tt class="py-string">""</tt><tt class="py-op">,</tt> <tt class="py-string">"this is a default value"</tt><tt class="py-op">,</tt> <tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">REG_SZ</tt><tt class="py-op">)</tt> </tt>
<a name="L76"></a><tt class="py-lineno">76</tt>  <tt class="py-line">    <tt id="link-4" class="py-name"><a title="simpleregistry.TestRegistryWriteRead" class="py-name" href="#" onclick="return doclink('link-4', 'TestRegistryWriteRead', 'link-3');">TestRegistryWriteRead</a></tt><tt class="py-op">(</tt><tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">HKEY_LOCAL_MACHINE</tt><tt class="py-op">,</tt> <tt class="py-string">"Software\\AAAAA"</tt><tt class="py-op">,</tt> <tt class="py-string">"Data-SZ"</tt><tt class="py-op">,</tt> <tt class="py-string">"this is a string"</tt><tt class="py-op">,</tt> <tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">REG_SZ</tt><tt class="py-op">)</tt> </tt>
<a name="L77"></a><tt class="py-lineno">77</tt>  <tt class="py-line">    <tt id="link-5" class="py-name"><a title="simpleregistry.TestRegistryWriteRead" class="py-name" href="#" onclick="return doclink('link-5', 'TestRegistryWriteRead', 'link-3');">TestRegistryWriteRead</a></tt><tt class="py-op">(</tt><tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">HKEY_LOCAL_MACHINE</tt><tt class="py-op">,</tt> <tt class="py-string">"Software\\AAAAA"</tt><tt class="py-op">,</tt> <tt class="py-string">"Data-BINARY"</tt><tt class="py-op">,</tt> <tt class="py-string">'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09'</tt><tt class="py-op">,</tt> <tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">REG_BINARY</tt><tt class="py-op">)</tt> </tt>
<a name="L78"></a><tt class="py-lineno">78</tt>  <tt class="py-line">    <tt id="link-6" class="py-name"><a title="simpleregistry.TestRegistryWriteRead" class="py-name" href="#" onclick="return doclink('link-6', 'TestRegistryWriteRead', 'link-3');">TestRegistryWriteRead</a></tt><tt class="py-op">(</tt><tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">HKEY_LOCAL_MACHINE</tt><tt class="py-op">,</tt> <tt class="py-string">"Software\\AAAAA"</tt><tt class="py-op">,</tt> <tt class="py-string">"Data-DWORD"</tt><tt class="py-op">,</tt> <tt class="py-number">0x01234567</tt><tt class="py-op">,</tt> <tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">REG_DWORD</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno">79</tt>  <tt class="py-line">    <tt id="link-7" class="py-name" targets="Function simpleregistry.DeleteRegistryKey()=simpleregistry-module.html#DeleteRegistryKey"><a title="simpleregistry.DeleteRegistryKey" class="py-name" href="#" onclick="return doclink('link-7', 'DeleteRegistryKey', 'link-7');">DeleteRegistryKey</a></tt><tt class="py-op">(</tt><tt class="py-name">win32con</tt><tt class="py-op">.</tt><tt class="py-name">HKEY_LOCAL_MACHINE</tt><tt class="py-op">,</tt> <tt class="py-string">"Software\\AAAAA"</tt><tt class="py-op">)</tt> </tt>
</div><a name="L80"></a><tt class="py-lineno">80</tt>  <tt class="py-line">     </tt>
<a name="L81"></a><tt class="py-lineno">81</tt>  <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">"__main__"</tt><tt class="py-op">:</tt> </tt>
<a name="L82"></a><tt class="py-lineno">82</tt>  <tt class="py-line">    <tt id="link-8" class="py-name" targets="Function simpleregistry.Test()=simpleregistry-module.html#Test"><a title="simpleregistry.Test" class="py-name" href="#" onclick="return doclink('link-8', 'Test', 'link-8');">Test</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L83"></a><tt class="py-lineno">83</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://code.google.com/p/pythongoogledesktop/">PyGoogleDesktop</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Fri Apr 04 23:08:55 2008
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
